package com.esri.core.tasks.geocode;

import com.esri.core.geometry.SpatialReference;
import com.esri.core.internal.util.d;
import com.esri.core.io.EsriServiceException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class LocatorServiceInfo {
    private String serviceDescription;
    private SpatialReference spatialReference;
    private List<LocatorFieldInfo> addressFields = new ArrayList();
    private List<LocatorFieldInfo> candidateFields = new ArrayList();
    private List<LocatorFieldInfo> intersectionCandidateFields = new ArrayList();
    private LocatorFieldInfo singleLineAddressField = null;
    private Map<String, String> locatorProperties = new HashMap();

    public String getServiceDescription() {
        return this.serviceDescription;
    }

    public List<LocatorFieldInfo> getAddressFields() {
        return this.addressFields;
    }

    public LocatorFieldInfo getSingleLineAddressField() {
        return this.singleLineAddressField;
    }

    public List<LocatorFieldInfo> getCandidateFields() {
        return this.candidateFields;
    }

    public List<LocatorFieldInfo> getIntersectionCandidateFields() {
        return this.intersectionCandidateFields;
    }

    public SpatialReference getSpatialReference() {
        return this.spatialReference;
    }

    public Map<String, String> getLocatorProperties() {
        return this.locatorProperties;
    }

    public static LocatorServiceInfo fromJson(JsonParser jsonParser) throws Exception {
        if (!d.c(jsonParser)) {
            throw new EsriServiceException("This response cannot be parsed.");
        }
        LocatorServiceInfo locatorServiceInfo = new LocatorServiceInfo();
        while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
            String currentName = jsonParser.getCurrentName();
            jsonParser.nextToken();
            if ("addressFields".equals(currentName)) {
                while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
                    locatorServiceInfo.addressFields.add(LocatorFieldInfo.fromJson(jsonParser));
                }
            } else if ("singleLineAddressField".equals(currentName)) {
                locatorServiceInfo.singleLineAddressField = LocatorFieldInfo.fromJson(jsonParser);
            } else if ("candidateFields".equals(currentName)) {
                while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
                    locatorServiceInfo.candidateFields.add(LocatorFieldInfo.fromJson(jsonParser));
                }
            } else if ("intersectionCandidateFields".equals(currentName)) {
                while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
                    locatorServiceInfo.candidateFields.add(LocatorFieldInfo.fromJson(jsonParser));
                }
            } else if ("serviceDescription".equals(currentName)) {
                locatorServiceInfo.serviceDescription = jsonParser.getText();
            } else if ("spatialReference".equals(currentName)) {
                locatorServiceInfo.spatialReference = SpatialReference.fromJson(jsonParser);
            } else if ("locatorProperties".equals(currentName)) {
                while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
                    String currentName2 = jsonParser.getCurrentName();
                    jsonParser.nextToken();
                    locatorServiceInfo.locatorProperties.put(currentName2, jsonParser.getText());
                }
            } else {
                jsonParser.skipChildren();
            }
        }
        return locatorServiceInfo;
    }

    public String toString() {
        return "GeocodeServiceInfo [addressFields=" + this.addressFields + ", candidateFields=" + this.candidateFields + ", intersectionCandidateFields=" + this.intersectionCandidateFields + ", locatorProperties=" + this.locatorProperties + ", serviceDescription=" + this.serviceDescription + ", spatialReference=" + this.spatialReference + "]";
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void setServiceDescription(String str) {
        this.serviceDescription = str;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void setAddressFields(List<LocatorFieldInfo> list) {
        this.addressFields = list;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void setSingleLineAddressField(LocatorFieldInfo locatorFieldInfo) {
        this.singleLineAddressField = locatorFieldInfo;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void setCandidateFields(List<LocatorFieldInfo> list) {
        this.candidateFields = list;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void setIntersectionCandidateFields(List<LocatorFieldInfo> list) {
        this.intersectionCandidateFields = list;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void setSpatialReference(SpatialReference spatialReference) {
        this.spatialReference = spatialReference;
    }
}
